home *** CD-ROM | disk | FTP | other *** search
- on openP
- global DBfact, TBfact
- set DBfact to xtra("V12Dbe")
- set TBfact to xtra("V12Table")
- end
-
- on createDB
- global DBfact
- set gDb to new(DBfact, the pathName & "UPDATE.DB", "cr", "imagine")
- mCreateTable(gDb, "update")
- put mCreateField(gDb, "update", "appname", "String", 255)
- put mCreateField(gDb, "update", "longname", "String", 255)
- put mCreateField(gDb, "update", "description", "String", 2000)
- put mCreateField(gDb, "update", "fileLoc", "String", 255)
- put mCreateField(gDb, "update", "contact", "String", 400)
- put mCreateField(gDb, "update", "url", "String", 255)
- put mCreateIndex(gDb, "update", "appIdx", "d", "appname", "a")
- put mBuild(gDb)
- set gDb to 0
- end
-
- on openDB
- global DBfact, TBfact, gDb, gTB
- set gDb to new(DBfact, the pathName & "UPDATE.DB", "ReadWrite", "imagine")
- set gTB to new(TBfact, mGetRef(gDb), "update")
- end
-
- on Import
- global DBfact, TBfact, gDb, gTB
- put mImportFile(gTB, the pathName & "updates.txt", TAB, RETURN)
- end
-
- on getOne
- global gTB
- put mGetField(gTB, "name", 1, 2)
- end
-
- on listIt
- global gTB
- put EMPTY into field "theList"
- set n to mSelectCount(gTB)
- repeat with i = 1 to n
- put mGetField(gTB, "category", "category") after field "theList"
- mGoNext(gTB)
- end repeat
- end
-
- on closeP
- global gTB, gDb
- set gTB to 0
- set gDb to 0
- end
-
- on CreateIt
- cursor(4)
- openP()
- createDB()
- openDB()
- Import()
- closeP()
- cursor(-1)
- end
-
- on ImportIt
- openDB()
- Import()
- closeP()
- end
-
- on showSelection
- global gTB
- cursor(4)
- set n to mSelectCount(gTB)
- put n into field "totalCount"
- set temp to mGetPosition(gTB)
- mGoFirst(gTB)
- put EMPTY into field "zList"
- set dummy to EMPTY
- repeat with i = 1 to n
- set nm to mGetField(gTB, "appname")
- put nm & RETURN after dummy
- mGoNext(gTB)
- end repeat
- put dummy into field "zList"
- mGo(gTB, temp)
- updateDisplay()
- cursor(-1)
- end
-
- on updateDisplay
- global gTB
- set i to mGetPosition(gTB)
- set the foreColor of field "zlist" to 255
- set the foreColor of line i of field "zlist" to 19
- put mGetField(gTB, "appname") into field "appname"
- put mGetField(gTB, "longname") into field "longname"
- put mGetField(gTB, "description") into field "description"
- put mGetField(gTB, "fileLoc") into field "fileLoc"
- put mGetField(gTB, "contact") into field "contact"
- put mGetField(gTB, "url") into field "url"
- end
-
- on domSelectCount
- global gTB
- put mSelectCount(gTB) into field "totalCount"
- end
-
- on CheckError errCode, msg
- global gDb
- if errCode <> 0 then
- if objectp(gDb) then
- set errTxt to mError(gDb, errCode)
- else
- set errText to "unknown error"
- end if
- alert("Error" && errCode && "(" & errTxt & ") occured at" && msg)
- end if
- end
-
- on TrackClick
- set spriteNum to the clickOn
- set offCast to the castNum of sprite spriteNum
- set onCast to offCast + 1
- set the castNum of sprite spriteNum to onCast
- updateStage()
- repeat while the mouseDown
- if rollOver(spriteNum) then
- set the castNum of sprite spriteNum to onCast
- else
- set the castNum of sprite spriteNum to offCast
- end if
- updateStage()
- end repeat
- set the castNum of sprite spriteNum to offCast
- updateStage()
- return rollOver(spriteNum)
- end
-
- on getdrive
- set curpath to the moviePath
- set olddelimiter to the itemDelimiter
- set the itemDelimiter to "\"
- set drive to item 1 of curpath & "\"
- set the itemDelimiter to olddelimiter
- return drive
- end
-
- on restartMe
- global DBfact, TBfact
- clearGlobals()
- openXLib(the pathName & "xtras:V12Dbe")
- openXLib(the pathName & "xtras:V12Table")
- set DBfact to xtra("V12Dbe")
- set TBfact to xtra("V12Table")
- set the visible of sprite 47 to 0
- put "All Shareware" into field "fld"
- end
-